<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Mosaddek">
    <meta name="keyword" content="FlatLab, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <link rel="shortcut icon" href="img/favicon.html">

    <title><%= basicFacts.name %> -- 首页</title>

    <!-- Bootstrap core CSS -->
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="/assets/font-awesome//css/font-awesome.css" rel="stylesheet" />
    <link href="/assets/jquery-easy-pie-chart/jquery.easy-pie-chart.css" rel="stylesheet" type="text/css" media="screen"/>
    <link href="/assets/jquery-ui/jquery-ui-1.10.1.custom.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/css/owl.carousel.css" type="text/css">
    <!-- Custom styles for this template -->
    <link href="/css/style.css" rel="stylesheet">
    <link href="/css/style-responsive.css" rel="stylesheet" />
    <link href="/css/odds.css" rel="stylesheet" />

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
    <script src="/js/html5shiv.js"></script>
    <script src="/js/respond.min.js"></script>
    <![endif]-->
    <script src="/js/jquery.js"></script>
</head>

<body>

<section id="container" class="">
    <!--header start-->
    <% include header.html %>
    <!--header end-->
    <!--sidebar start-->
    <% include aside.html %>
    <!--sidebar end-->
    <!--main content start-->
    <section id="main-content">
        <section class="wrapper">
            <section class="panel">
                <header class="panel-heading">中奖几率设置</header>
                <form class="panel-body" action="/admin/odds/save" method="post">
                    <table class="table sliders" style="width: 50%;margin: 0 auto;">
                        <tr>
                            <td style="width:14%">一等奖</td>
                            <td style="width:70%">
                                <div id="slider-range-min-a" class="slider"></div>
                                <div class="slider-info">
                                    中奖几率:
                                    <span class="slider-info" id="slider-range-min-amount-a"><%= data.a %>%</span>
                                    <input type="hidden" name="a" value="<%= data.a %>" id="slider-range-min-val-a" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:14%">二等奖</td>
                            <td>
                                <div id="slider-range-min-b" class="slider"></div>
                                <div class="slider-info">
                                    中奖几率:
                                    <span class="slider-info" id="slider-range-min-amount-b"><%= data.b %>%</span>
                                    <input type="hidden" name="b" value="<%= data.b %>" id="slider-range-min-val-b" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:14%">三等奖</td>
                            <td>
                                <div id="slider-range-min-c" class="slider"></div>
                                <div class="slider-info">
                                    中奖几率:
                                    <span class="slider-info" id="slider-range-min-amount-c"><%= data.c %>%</span>
                                    <input type="hidden" name="c" value="<%= data.c %>" id="slider-range-min-val-c" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:14%">四等奖</td>
                            <td>
                                <div id="slider-range-min-d" class="slider"></div>
                                <div class="slider-info">
                                    中奖几率:
                                    <span class="slider-info" id="slider-range-min-amount-d"><%= data.d %>%</span>
                                    <input type="hidden" name="d" value="<%= data.d %>" id="slider-range-min-val-d" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:14%">总几率</td>
                            <td>
                                <span class="slider-info" id="slider-range-min-amount-all"><%= data.all %>%</span>
                                <input type="hidden" name="all" value="<%= data.all %>" id="slider-all" />
                            </td>
                        </tr>
                    </table>
                    <div class="panel-body" style="text-align: center"><button class="btn btn-shadow btn-success">&nbsp;&nbsp;&nbsp;&nbsp;修改设置&nbsp;&nbsp;&nbsp;&nbsp;</button></div>
                </form>
            </section>
        </section>
    </section>
    <!--main content end-->
</section>

<<script src="/js/jquery.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery.scrollTo.min.js"></script>
<script src="/js/jquery.nicescroll.js" type="text/javascript"></script>
<script src="/assets/jquery-ui/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>


<!--common script for all pages-->
<script src="/js/common-scripts.js"></script>
<script>
    $("#slider-range-min-a").slider({
        range: "min",
        value: <%- data.a %>,
        min: 0,
        max: 25,
        slide: function (event, ui) {
            $("#slider-range-min-amount-a").html(ui.value+'%');
            $('#slider-range-min-val-a').val(ui.value);
            all();
        }
    });
    $("#slider-range-min-b").slider({
        range: "min",
        value: <%- data.b %>,
        min: 0,
        max: 25,
        slide: function (event, ui) {
            $("#slider-range-min-amount-b").html(ui.value+'%');
            $('#slider-range-min-val-b').val(ui.value);
            all();
        }
    });
    $("#slider-range-min-c").slider({
        range: "min",
        value: <%- data.c %>,
        min: 0,
        max: 25,
        slide: function (event, ui) {
            $("#slider-range-min-amount-c").html(ui.value+'%');
            $('#slider-range-min-val-c').val(ui.value);
            all();
        }
    });
    $("#slider-range-min-d").slider({
        range: "min",
        value: <%- data.d %>,
        min: 0,
        max: 25,
        slide: function (event, ui) {
            $("#slider-range-min-amount-d").html(ui.value+'%');
            $('#slider-range-min-val-d').val(ui.value);
            all();
        }
    });

    var all = function(){
        var allValue = parseInt($('#slider-range-min-val-d').val()) + parseInt($('#slider-range-min-val-c').val()) + parseInt($('#slider-range-min-val-b').val()) + parseInt($('#slider-range-min-val-a').val());
        $('#slider-all').val(allValue)
        $('#slider-range-min-amount-all').html(allValue+'%');
    };
</script>
</body>
</html>
